<template>
	<view>
		<text @click="submit" :style="style_">{{texta}}</text>
		<text @click="submit" v-if="text1" :style="style_">{{text1}}</text>
	</view>
</template>

<script>
	export default {
		name: "my-text",
		props: ['text','text1','style_'],
		data() {
			return {
				texta: ""
			};
		},
		watch: {
			contractFile(a) {
				this.getinfo()
			}
		},
		computed: {
			contractFile() {
				return this.$store.state.ziti
			}
		},
		methods: {
			submit(){
				this.$emit("onchange")
			},
			getinfo() {
				this.api('usermsg/transform', {
					type: this.$store.state.ziti,
					name: this.text
				}).then(res => {
					this.texta = res.data
				})
			}
		},
		mounted() {
			this.getinfo()
		}
	}
</script>

<style lang="less">

</style>
